package controller

import (
	"github.com/gin-gonic/gin"
	"go-web/service"
	"strconv"
)

func FindBookBorrowedByMemberId(c *gin.Context) {
	memberId, _ := strconv.Atoi(c.Param("memberId"))
	borrowRecords := service.FindBookBorrowedByMemberId(memberId)
	c.JSON(200, gin.H{
		"code": 200,
		"data": borrowRecords,
	})
}

func FindBookBorrowInfoByMemberId(c *gin.Context) {
	memberId, _ := strconv.Atoi(c.Param("memberId"))
	infos := service.FindBorrowInfoByMemberId(memberId)
	c.JSON(200, gin.H{
		"code": 200,
		"data": infos,
	})
}
